const {
    Rule,
    LinValidator
  } = require('../../core/lin-validator-v2')
  

  class ProjectValidator extends LinValidator {
    constructor() {
      super();
  
      this.name = [new Rule("isLength", "项目名称 name 不能为空", {min: 1})];
      this.apikey = [new Rule("isLength", "项目秘钥 apikey 不能为空", {min: 1})];
      this.code = [new Rule("isLength", "项目编码 code 不能为空", {min: 1})];
    }
 
  }

  class ProjectIdParamsValidator extends LinValidator {
      constructor() {
          super()
          this.keyword = [
            new Rule('isInt', '项目ID需要正整数', {min: 1})
        ]
      }
  }
  
  class ProjectSearchValidator extends LinValidator {
      constructor() {
          super()
          this.keyword = [
              new Rule('isLength', '必须传入搜索关键字', {min: 1})
          ]
      }
  }
 
  
  module.exports = {
    ProjectValidator,
    ProjectIdParamsValidator,
    ProjectSearchValidator
  }
  